/*
 * @Author: 郭招娣 10615594+guo-zhaodi@user.noreply.gitee.com
 * @Date: 2022-11-02 10:32:39
 * @LastEditors: 郭招娣 10615594+guo-zhaodi@user.noreply.gitee.com
 * @LastEditTime: 2022-11-04 14:53:11
 * @FilePath: \宏烨找房\agent\src\page\Home\index.jsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import React, { useEffect, useState } from 'react'
import './index.css';
import { useNavigate } from 'react-router-dom';
import { useSelector } from 'react-redux'
import { httpNewHousing } from '../../api/housing';
const Home = () => {
    const [newHousing,setNewHousing]=useState(0);
    const [oldHousing, setOldHousing] = useState(0);

    const navigate = useNavigate();
    const getNewHousing=async ()=>{
        const res = await httpNewHousing('/agentnewhousing');
        console.log(res)
        setNewHousing(res.data.total);
    }
    const getOldHousing = async () => {
        const res = await httpNewHousing('/agentoldhousing');
        console.log(res)
        setOldHousing(res.data.total);
    }
    useEffect(() => {
        getNewHousing()
        getOldHousing()
    }, [])
    const user = useSelector((state) => state.user);
    return (
        <div className='content'>
            <div className="homeTop">
                <span style={{color:'#fff',fontSize:'20px',margin:'10px'}}>宏烨经纪人</span>
                <div className="info">
                    <img src={user.img} alt="" />
                    <span>{user.username}</span>

                </div>
            </div>
            <div className="houseBox">
                <div className="newHouse">
                    <span>{newHousing}</span>
                    <span>新房</span>
                </div>
                <div className="newHouse">
                    <span>{oldHousing}</span>
                    <span>二手房</span>
                </div>
                <div className="newHouse">
                    <span>562</span>
                    <span>出租房</span>
                </div>
            </div>

            <div className="null"></div>
            <div className="list">
                <dl onClick={() => { navigate('/message') }}>
                    <dt><svg t="1667453834891" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11035" width="30" height="30"><path d="M588.288 144.64s160.64 22.144 263.488 169.408c0 0 137.856 185.152-45.632 378.88 0 0-24.384 21.312-17.92 56.448l24.32 118.272-159.616-62.4s-29.568-14.144-53.248-1.024c0 0-151.296 46.144-334.784-52.352 0 0-231.552-121.28-151.552-375.872 0 0 93.952-286.656 474.944-231.36z" fill="#14FF8E" p-id="11036"></path><path d="M833.088 730.752c69.312-83.392 113.6-150.528 113.6-254.976 0-70.272-23.04-135.552-61.632-192.064l-0.448-0.704c-0.896-1.28-1.472-2.688-2.368-3.968l-0.192 0.128a21.888 21.888 0 0 0-17.664-9.28 22.4 22.4 0 0 0-22.4 22.4c0 5.76 2.304 10.944 5.952 14.912l-0.448 0.32c34.048 49.664 54.4 106.816 54.4 168.192 0 86.784-33.344 142.144-103.232 226.368-17.728 21.44-12.928 42.88 1.408 106.432 3.584 15.744 8.832 38.976 12.48 59.072a2067.072 2067.072 0 0 1-97.088-37.824c-61.376-25.152-75.968-30.528-90.624-30.528h-6.08l-6.848 1.728c-40.768 11.136-63.04 13.888-113.216 13.888-222.336 0-403.2-152.128-403.2-339.136s180.864-339.2 403.2-339.2c27.712 0 54.784 2.368 81.024 6.848l0.192-0.512a20.736 20.736 0 0 0 8.384 1.792 22.464 22.464 0 0 0 22.464-22.4 22.08 22.08 0 0 0-16.704-21.248l0.128-0.256c-1.664-0.32-3.456-0.448-5.056-0.704-0.32 0-0.512-0.192-0.832-0.192H588.16a518.592 518.592 0 0 0-89.472-8.064c-247.424 0-448 171.968-448 384 0 212.096 200.576 384 448 384 51.712 0 78.656-2.816 125.248-15.552 13.44-3.776 214.08 93.952 233.088 75.968 19.712-18.816-32.896-178.624-23.936-189.44z" fill="" p-id="11037"></path><path d="M672 169.92a408.512 408.512 0 0 1 130.048 83.328l0.256-0.192a21.76 21.76 0 0 0 17.28 8.704 22.464 22.464 0 0 0 22.464-22.4 21.952 21.952 0 0 0-8.448-17.088l0.448-0.384a451.584 451.584 0 0 0-144-92.736l-1.344-0.576c-0.832-0.256-1.472-0.704-2.24-1.024L686.272 128c-1.856-0.512-3.712-1.152-5.696-1.152a22.4 22.4 0 0 0-8.576 43.072z" fill="" p-id="11038"></path><path d="M172.352 434.432a22.464 22.464 0 0 1-20.992-30.208C220.992 217.6 387.2 194.752 394.24 193.92a22.4 22.4 0 0 1 24.96 19.392 22.528 22.528 0 0 1-19.328 25.088c-6.016 0.704-146.688 20.992-206.528 181.44a22.4 22.4 0 0 1-20.992 14.592z" fill="#FFFFFF" p-id="11039"></path><path d="M158.976 478.4m-22.4 0a22.4 22.4 0 1 0 44.8 0 22.4 22.4 0 1 0-44.8 0Z" fill="#FFFFFF" p-id="11040"></path><path d="M333.056 539.2a67.264 67.264 0 0 1 0-134.4 67.264 67.264 0 0 1 0 134.4z m0-89.6a22.4 22.4 0 1 0 0 44.8 22.4 22.4 0 0 0 0-44.8zM504.448 539.2a67.264 67.264 0 0 1 0-134.4c37.12 0 67.264 30.144 67.264 67.2 0 37.056-30.208 67.2-67.264 67.2z m0-89.6a22.4 22.4 0 1 0 0 44.8 22.4 22.4 0 0 0 0-44.8zM676.032 539.2c-37.12 0-67.264-30.144-67.264-67.2a67.2 67.2 0 1 1 67.264 67.2z m0-89.6c-12.352 0-22.528 10.048-22.528 22.4a22.464 22.464 0 0 0 44.928 0 22.464 22.464 0 0 0-22.4-22.4z" fill="" p-id="11041"></path></svg></dt>
                    <dd>消息</dd>
                </dl>
                <dl onClick={() => { navigate('/rentHouse') }}>
                    <dt><svg t="1667454351388" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11646" width="30" height="30"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#F49E34" p-id="11647"></path><path d="M650.604434 467.192532L522.455076 342.826916a14.935823 14.935823 0 0 0-20.910152 0L373.395566 467.192532a15.234539 15.234539 0 0 1-9.957215 4.281603h-59.743291a14.935823 14.935823 0 0 0-14.935822 14.935822v285.971218A14.139245 14.139245 0 0 0 302.101906 786.619992h124.365616a15.035395 15.035395 0 0 0 14.935823-15.035395v-95.887981a34.352392 34.352392 0 0 1 34.451964-34.352392h72.289382a34.352392 34.352392 0 0 1 34.451964 34.352392v95.788409A15.035395 15.035395 0 0 0 597.432905 786.619992h123.469468a15.035395 15.035395 0 0 0 14.935822-15.035395V486.409957a14.935823 14.935823 0 0 0-14.935822-14.935822h-59.743291a15.234539 15.234539 0 0 1-10.554648-4.281603z" fill="#FAFAFA" p-id="11648"></path><path d="M281.307997 580.044075m-13.377548-13.377548l-33.514276-33.514276q-13.377547-13.377547 0-26.755094l263.256047-263.256047q13.377547-13.377547 26.755095 0l33.514276 33.514276q13.377547 13.377547 0 26.755094l-263.256047 263.256047q-13.377547 13.377547-26.755095 0Z" fill="#FFFFFF" p-id="11649"></path><path d="M802.971331 519.750665m-13.377547 13.377547l-33.514276 33.514277q-13.377547 13.377547-26.755095 0l-263.256047-263.256048q-13.377547-13.377547 0-26.755094l33.514276-33.514276q13.377547-13.377547 26.755095 0l263.256047 263.256047q13.377547 13.377547 0 26.755094Z" fill="#FFFFFF" p-id="11650"></path></svg></dt>
                    <dd>求租</dd>
                </dl>
                <dl onClick={() => { navigate('/buyHouse') }}>
                    <dt><svg t="1667475181575" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1890" width="30" height="30"><path d="M935.8336 457.8816l-97.2288-86.8352V235.008c0-21.0432-17.1008-38.144-38.144-38.144h-77.2096c-20.6848 0-37.5808 16.5888-38.144 37.12l-133.2736-118.9888a64.512 64.512 0 0 0-86.1184 0.1536l-375.808 337.5104c-18.0736 16.2304-24.1664 41.3696-15.4624 64.1024 8.704 22.6816 30.0032 37.376 54.3232 37.376h67.9424v263.424c0 48.5888 39.5264 88.1152 88.1152 88.1152h454.2976c48.5888 0 88.1152-39.5264 88.1152-88.1152v-263.424h71.7824c23.04 0 43.264-13.9264 51.5072-35.4816 8.2944-21.6064 2.5088-45.4144-14.6944-60.7744z m-313.7024 137.1648c16.9472 0 30.72 13.7728 30.72 30.72s-13.7728 30.72-30.72 30.72h-78.9504v52.1216c0 16.9472-13.7728 30.72-30.72 30.72s-30.72-13.7728-30.72-30.72v-52.1216H402.7392c-16.9472 0-30.72-13.7728-30.72-30.72s13.7728-30.72 30.72-30.72h78.9504v-41.472H402.7392c-16.9472 0-30.72-13.7728-30.72-30.72s13.7728-30.72 30.72-30.72h43.4176l-51.6608-50.5344c-12.1344-11.8784-12.3392-31.3344-0.4608-43.4176 11.8784-12.1344 31.3344-12.3392 43.4176-0.4608l74.9056 73.2672 75.008-73.2672a30.78144 30.78144 0 0 1 43.4688 0.512c11.8784 12.1344 11.6224 31.5904-0.512 43.4688l-51.712 50.4832h43.4688c16.9472 0 30.72 13.7728 30.72 30.72s-13.7728 30.72-30.72 30.72h-78.9504v41.472h79.0016z" fill="#F39800" p-id="1891"></path></svg></dt>
                    <dd>求购</dd>
                </dl>
                <dl onClick={() => { navigate('/cityCircle') }}>
                    <dt><svg t="1667475973471" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5145" width="30" height="30"><path d="M575.12 131l94.74 192a47.68 47.68 0 0 0 35.9 26.08l211.84 30.78c39.11 5.68 54.72 53.74 26.43 81.33l-153.3 149.39a47.68 47.68 0 0 0-13.73 42.2l36.19 211c6.68 39-34.2 68.65-69.18 50.26l-189.46-99.62a47.68 47.68 0 0 0-44.38 0L320.7 914c-35 18.39-75.86-11.31-69.18-50.26l36.19-211A47.68 47.68 0 0 0 274 610.58L120.7 461.16c-28.3-27.58-12.68-75.65 26.43-81.33L359 349.05A47.68 47.68 0 0 0 394.87 323l94.73-192c17.49-35.43 68.03-35.43 85.52 0z" fill="#FED547" p-id="5146"></path><path d="M943.3 461.77c28.3-27.58 12.68-75.65-26.43-81.33L705 349.66a47.68 47.68 0 0 1-35.9-26.08l-94.74-192c-16.31-33.05-61.35-35.25-81.53-6.65a49.51 49.51 0 0 1 4 6.65l94.74 192a47.68 47.68 0 0 0 35.9 26.08l211.84 30.78c39.11 5.68 54.72 53.74 26.43 81.33L712.47 611.19a47.68 47.68 0 0 0-13.71 42.2l36.19 211a46.76 46.76 0 0 1-11.52 39.81l19.89 10.46c35 18.39 75.86-11.31 69.18-50.26l-36.19-211A47.68 47.68 0 0 1 790 611.19z" fill="#E2B742" p-id="5147"></path><path d="M263.93 925.77a54 54 0 0 1-53.06-63.05l36.19-211A41.47 41.47 0 0 0 235.13 615L81.85 465.6a53.88 53.88 0 0 1 29.87-91.9l211.83-30.78a41.51 41.51 0 0 0 31.23-22.69l94.73-192a53.89 53.89 0 0 1 96.64 0l94.74 192a41.5 41.5 0 0 0 31.23 22.69L884 373.7a53.88 53.88 0 0 1 29.86 91.9L760.53 615a41.45 41.45 0 0 0-11.93 36.71l36.19 211a53.88 53.88 0 0 1-78.18 56.8l-189.48-99.6a41.49 41.49 0 0 0-38.6 0l-189.47 99.61a53.86 53.86 0 0 1-25.13 6.25z m233.9-815.13a40.71 40.71 0 0 0-37.19 23.12l-94.73 192a53.89 53.89 0 0 1-40.57 29.47L113.5 386a41.48 41.48 0 0 0-23 70.75l153.3 149.39a53.88 53.88 0 0 1 15.5 47.69l-36.19 211a41.48 41.48 0 0 0 60.18 43.73l189.48-99.61a53.81 53.81 0 0 1 50.15 0l189.47 99.61a41.48 41.48 0 0 0 60.18-43.73l-36.19-211a53.86 53.86 0 0 1 15.5-47.69l153.28-149.42a41.48 41.48 0 0 0-23-70.75l-211.82-30.78a53.88 53.88 0 0 1-40.57-29.47L535 133.75a40.71 40.71 0 0 0-37.17-23.12z" fill="#28CA67" p-id="5148"></path></svg></dt>
                    <dd>楼市圈</dd>
                </dl>
                <dl onClick={() => { navigate('/live') }}>
                    <dt><svg t="1667476127961" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6120" width="30" height="30"><path d="M378.6 313.3c0 58.2-47.2 105.4-105.4 105.4s-105.4-47.2-105.4-105.4S215 207.9 273.2 207.9s105.4 47.2 105.4 105.4" fill="#23ADE5" p-id="6121"></path><path d="M584.5 418.7c90.6 0 164-73.4 164-164s-73.4-164-164-164-164 73.4-164 164 73.4 164 164 164zM873.8 527.5l-72.6 41.9v-55.3c0-45.2-37-82.1-82.1-82.1H148.3c-45.2 0-82.1 37-82.1 82.1v337.1c0 45.2 37 82.1 82.1 82.1H719c45.2 0 82.1-37 82.1-82.1V824l72.6 41.9c38.9 22.5 87.6-5.6 87.6-50.6V578c0-44.9-48.6-73-87.5-50.5z" fill="#48CFE5" p-id="6122"></path><path d="M415.8 582.8l141.7 81.8c18.7 10.8 18.7 37.9 0 48.7l-141.7 81.8c-18.7 10.8-42.2-2.7-42.2-24.4V607.1c0.1-21.6 23.5-35.1 42.2-24.3" fill="#FDDE80" p-id="6123"></path></svg></dt>
                    <dd>直播</dd>
                </dl>
                <dl onClick={()=>{navigate('/bulk')}}>
                    <dt><svg t="1667476327537" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6956" width="30" height="30"><path d="M507.392 513.1264m-450.816 0a450.816 450.816 0 1 0 901.632 0 450.816 450.816 0 1 0-901.632 0Z" fill="#FFBC42" p-id="6957"></path><path d="M663.7056 330.24l-148.3264-139.776c-23.5008-22.1696-60.2624-22.1184-83.712 0.0512L283.8016 330.24a60.99968 60.99968 0 0 0-19.0976 44.3392v361.0624c0 33.6896 27.2896 60.9792 60.9792 60.9792h296.1408c33.6896 0 60.9792-27.2896 60.9792-60.9792V374.6304c0.0512-16.7936-6.912-32.8704-19.0976-44.3904z m-188.416-47.7184c19.3024 0 35.0208 15.6672 35.0208 35.0208 0 19.3024-15.6672 35.0208-35.0208 35.0208s-35.0208-15.6672-35.0208-35.0208 15.6672-35.0208 35.0208-35.0208z m-61.5424 395.8272l38.6048-111.616H381.1328L501.248 429.7728l-7.68 101.8368 63.7952 3.1744-143.616 143.5648zM718.4384 460.0832l89.6 176.896c10.6496 20.992 2.816 46.6432-17.7152 58.1632l-73.216 40.96 1.3312-276.0192z" fill="#FFFFFF" p-id="6958"></path></svg></dt>
                    <dd>团购</dd>
                </dl>
                <dl>
                    <dt><svg t="1667476733449" class="icon" viewBox="0 0 2035 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7911" width="40" height="40"><path d="M2629.9377777 197.65333333c3.09333333-0.10666667 6.08-0.10666667 9.17333333-0.10666666" fill="#ffcd00" p-id="7912"></path><path d="M1012.6577777 717.01333333c-82.13333333 0-159.25333333-32.74666667-217.28-92.26666666-58.02666667-59.52-90.02666667-138.66666667-90.02666667-222.82666667V34.34666667h617.38666667v364.69333333c0 84.90666667-32.21333333 164.8-90.77333333 224.85333333s-136.42666667 93.12-219.30666667 93.12zM780.0177777 110.93333333v290.98666667c0 131.52 104.32 238.50666667 232.64 238.50666667 129.81333333 0 235.41333333-108.26666667 235.41333333-241.38666667V110.93333333H780.0177777z" fill="#ffcd00" p-id="7913"></path><path d="M976.66844437 955.85066667l1.06453333-280.85333334 74.66666667 0.28373334-1.0656 280.85333333z" fill="#ffcd00" p-id="7914"></path><path d="M810.2321777 986.5728l0.91733333-106.66666667 408.85333334 3.5136-0.91733334 106.66666667zM929.4705777 325.44746667l133.96906667-136.8032 38.10666666 37.31733333-133.96906666 136.8032zM927.7009777 495.73866667l136.52693333-140.86293334 38.29866667 37.12-136.52693333 140.86293334zM1285.2977777 445.44v-49.28c51.52 0 86.72-26.13333333 107.84-79.68 16.32-41.6 17.06666667-83.41333333 17.06666667-85.12v-38.4h-117.33333334v-49.28H1455.64444437v87.89333333c0 2.13333333-0.53333333 52.8-20.69333334 104.10666667-12.26666667 31.25333333-29.33333333 56.42666667-50.66666666 74.77333333-26.98666667 23.14666667-60.26666667 34.98666667-98.98666667 34.98666667zM743.00444437 443.84v-51.09333333c-51.30666667 0-86.4-27.09333333-107.41333334-82.77333334-16.32-43.2-16.96-86.61333333-16.96-88.32v-39.89333333h116.69333334v-51.09333333h-162.13333334V221.86666667c0 2.24 0.53333333 54.82666667 20.58666667 108.05333333 12.26666667 32.53333333 29.22666667 58.56 50.56 77.65333333 26.88 24 60.05333333 36.26666667 98.66666667 36.26666667z" fill="#ffcd00" p-id="7915"></path></svg></dt>
                    <dd>排行榜</dd>
                </dl>
                <dl>
                    <dt><svg t="1667476806205" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8125" width="30" height="30"><path d="M953.770667 192a42.666667 42.666667 0 0 1 42.56 39.466667l0.106666 3.2v245.333333a42.666667 42.666667 0 0 1-39.466666 42.56l-3.2 0.106667H789.333333v-85.333334h121.770667V277.333333H810.666667V192h143.104z m-746.666667 0v85.333333H106.666667v160h121.770666v85.333334H64l-3.2-0.106667A42.666667 42.666667 0 0 1 21.333333 480V234.666667l0.106667-3.2A42.666667 42.666667 0 0 1 64 192h143.104z" fill="#1971FF" p-id="8126"></path><path d="M384 960a21.333333 21.333333 0 0 1-21.333333-21.333333v-42.666667a21.333333 21.333333 0 0 1 21.333333-21.333333h85.333333v-105.536a127.936 127.936 0 0 1-15.744-6.784l-4.949333-2.688-213.333333-121.536A128 128 0 0 1 170.666667 526.890667V106.666667a42.666667 42.666667 0 0 1 42.666666-42.666667h597.333334a42.666667 42.666667 0 0 1 42.666666 42.666667v420.224a128 128 0 0 1-64.64 111.232l-213.333333 121.536a128 128 0 0 1-20.693333 9.472V874.666667h85.333333a21.333333 21.333333 0 0 1 21.333333 21.333333v42.666667a21.333333 21.333333 0 0 1-21.333333 21.333333H384zM768 149.333333H256v377.557334a42.666667 42.666667 0 0 0 18.56 35.2l2.986667 1.877333 213.333333 121.557333a42.666667 42.666667 0 0 0 42.24 0l213.333333-121.557333A42.666667 42.666667 0 0 0 768 526.890667V149.333333z" fill="#333333" p-id="8127"></path></svg></dt>
                    <dd>战绩</dd>
                </dl>
            </div>
        </div>
    )
}
export default Home;